/* Task.cs - Projekt-Daten - Beschreibt den Task
 * Copyright (C) 2009 Dietmar Schinnerl
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
 */

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace App.Net
{
    [Serializable]
    public class Task : Element
    { 
        public int EstimatedHours;
        public int WorkedHours;
        public bool Active;
        public Utilities.CalenderDate EarliestStartDate;
        public Utilities.CalenderDate ExpectedEndDate;
        public string Predecessors;
        public int FinishWithTaskId;
        public int IsState;
        [XmlIgnore]
        public int TargetState;
        public string Notes;
        [XmlIgnore]
        private Color color;
        public int Argb
        {
            set
            {
                color = Color.FromArgb(value);
            }
            get
            {
                return color.ToArgb();
            }
        }
        public List<Predecessor> PredecessorList;
        public List<SkilledWorker> SkilledWorkerList;

        public Task()
        {
            SkilledWorkerList = new List<SkilledWorker>();
            PredecessorList = new List<Predecessor>();
            EarliestStartDate = new Utilities.CalenderDate(DateTime.Now);
            ExpectedEndDate = new Utilities.CalenderDate(DateTime.Now.AddDays(30));
            color = Color.Black;
        }


        public int RemainingHours
        {
            get
            {
                return (100 - IsState) * EstimatedHours / 100;
            }

        }

    }//end Task

}




















































































































































